import http from '../plugins/http';

interface IUserModal {
    token: string;
    username: string;
}
interface IUserResultModal {
    code: number;
    data: IUserModal;
    msg: string;
}

export const login = async (username: string, password: string) => {
    const result: IUserResultModal = await http.request({
        method: 'post',
        url: '/api/login',
        data: {
            username, password
        }
    })
    return result;
}